// VolDiaDlg.h : header file
//

#if !defined(AFX_VOLDIADLG_H__2CA868C6_52D0_4B30_B465_D26D947791AE__INCLUDED_)
#define AFX_VOLDIADLG_H__2CA868C6_52D0_4B30_B465_D26D947791AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



#include "ContainerSel.h"
#include "ElemMove.h"
#include "MainMasSel.h"
#include "PhaseExec.h"
#include "PhasePerm.h"
#include "PosInfo.h"
#include "ChModSel.h"
#include "CampDlg.h"
#include "TechCycle.h"
#include "DB_op.h"
#include "DelCyc.h"
#include "ChangeOp.h"
#include "RodInfo.h"
#include "ObjMov.h"
#include "TecCycConfirm.h"
#include "TCStartCond.h"
#include "FinishCamp.h"
#include "ReportDlg.h"
#include "TuneInfi.h"
#include "ConfManag.h"
#include "SimulCtrl.h"
#include "Maint.h"
#include "ManualMode.h"
#include "ellsManag.h"
#include "TuneWait.h"
#include "WaterManag.h"

/////////////////////////////////////////////////////////////////////////////
// CVolDiaDlg dialog

typedef struct{
	DWORD		m_opStation;
	bool		m_active;
}CS_DATA;

class CVolDiaDlg : public CDialog
{
// Construction
public:
	CChModSel		*m_pChModSelDialog;
	CContainerSel	*m_pContainerSelDialog;
	CElemMove		*m_pElemMoveDialog;
	CMainMasSel		*m_pMainMasSelDialog;
	CPhaseExec		*m_pPhaseExecDialog;
	CTCStartCond	*m_pPhasePermDialog;
	CPosInfo		*m_pPosInfoDialog;
	CCampDlg		*m_pCampaign;
	CTechCycle		*m_pTechCycle;
	CDB_op			*m_pDB_op;
	CDelCyc			*m_pDelCyc;
	CChangeOp		*m_pChangeOp;
	CRodInfo		*m_pRodInfo;
	CObjMov			*m_pObjMov;
	CReportDlg		*m_pReportDlg;
	CTuneInfi		*m_pTuneInfiDlg;
	CConfManag		*m_pConfManagDlg;
	CSimulCtrl		*m_pSimulCtrl;
	CMaint			*m_pMaint;
	ManualMode		*m_pManual;
	CellsManag		*m_pCellsManag;
	CTuneWait		*m_pTuneWait;
	CWaterManag		*m_pWaterManag;

	CWinThread		*m_pAcquisitionThread;
	CWinThread		*m_pTrackThread;
	CWinThread		*m_pSafeChecksThread;
	CWinThread		*m_pManBeeperThread;
	CWinThread		*m_pConfSaveThread;
	CWinThread		*m_pObjMoverThread;
	CWinThread		*m_pSpSetterThread;
	CWinThread		*m_pOpMonitorThread;

	TAGIDX			m_tiBridgePos;
	TAGIDX			m_tiTrolleyPos;
	TAGIDX			m_tiMMPos;
	TAGIDX			m_tiMMFixOp;
	TAGIDX			m_tiMMFixCl;
	TAGIDX			m_tiMMClusPos;
	TAGIDX			m_tiMMRotPos;
	TAGIDX			m_tiTVPos;
	TAGIDX			m_tiTVRotPos;
	TAGIDX			m_tiMMDispl_up;
	TAGIDX			m_tiMMDispl_lo;
	TAGIDX			m_tiFALV_up;
	TAGIDX			m_tiFALV_down;

	TAGIDX			m_tiMMmount;
	TAGIDX			m_tiTVmount;
	TAGIDX			m_tiDIMPMount;

	TAGIDX			m_tiBridgeSp;
	TAGIDX			m_tiTrolleySp;
	TAGIDX			m_tiMMSp;
	TAGIDX			m_tiMMClusSp;
	TAGIDX			m_tiMMRotSp;
	TAGIDX			m_tiTVSp;
	TAGIDX			m_tiTVRotSp;
	TAGIDX			m_tiMMUnfixReq;
	TAGIDX			m_tiMMFixReq;
	TAGIDX			m_tiMMDispl_lo_req;
	TAGIDX			m_tiMMDispl_hi_req;
	TAGIDX			m_tiFALVL_up_req;
	TAGIDX			m_tiFALVL_dwn_req;

	TAGIDX			m_tiBridgeMreq;
	TAGIDX			m_tiTrolleyMreq;
	TAGIDX			m_tiMMMreq;
	TAGIDX			m_tiMMClusMreq;
	TAGIDX			m_tiMMRotMreq;
	TAGIDX			m_tiTVMreq;
	TAGIDX			m_tiTVRotMreq;
	TAGIDX			m_tiMMFixMreq;
	TAGIDX			m_tiMMDisplMreq;
	TAGIDX			m_tiFALVMreq;
	TAGIDX			m_tiFALVMount;

	TAGIDX			m_tiStart;
	TAGIDX			m_tiOP_OK;
	TAGIDX			m_tiOP_NOT_OK;

	TAGIDX			m_tiResetTrip;
	
	TAGIDX			m_tiBridge_v;
	TAGIDX			m_tiTrolley_v;
	TAGIDX			m_tiMM_v;
	TAGIDX			m_tiMMFix_v;
	TAGIDX			m_tiMMClus_v;
	TAGIDX			m_tiTV_v;
	TAGIDX			m_tiTVR_r;
	TAGIDX			m_tiTVR_l;
	TAGIDX			m_tiMMDisplToUp;
	TAGIDX			m_tiMMDisplToDown;

	TAGIDX			m_tiMM_exp;
	TAGIDX			m_tiMM_act;
	TAGIDX			m_tiCl_exp;
	TAGIDX			m_tiCl_act;
	TAGIDX			m_tiDispl_A;
	TAGIDX			m_tiDispl_B;

	CS_DATA			m_csData;
	DWORD			m_opStation;	
	int				m_loggedUser;
	bool			m_TrackingMast;
	bool			m_SafeChecks;
	bool			m_ManBeeper;
	bool			m_Acquisition;
	bool			m_ConfSave;
	bool			m_objMover;
	bool			m_spSetter;
	int				m_waitReason;
	bool			m_Closed;
	int				m_Station;
	int				m_ProgTermOKFlag;
	bool			m_EleMovOpened;
	bool			m_TecCycOpened;
	bool			m_ManModeOpened;
	bool			m_ignoreOpChange;

	void ActivateSafeChecks(void);
	void DeactivateSafeChecks(void);
	void ActivateMastTracking(void);
	void DeactivateMastTracking(void);
	void ActivateManBeeper(void);
	void DeactivateManBeeper(void);
	void ActivateAcquisition(void);
	void DeactivateAcquisition(void);
	void ActivateConfSave(void);
	void DeactivateConfSave(void);
	void SuspendConfSave(void);
	void ResumeConfSave(void);
	void ActivateObjMover(void);
	void DeactivateObjMover(void);
	void ActivateSpSetter(void);
	void DeactivateSpSetter(void);
	void ActivateOpMonitor(void);
	void DeactivateOpMonitor(void);
	bool LoadTagIdx(void);

	bool LoadRegistryData(void);
	bool GetProgTerminationOKFlag(void);
	bool SetProgTerminationOKFlag(int flag);

	LRESULT OnDialogActivation( WPARAM wParam, LPARAM lParam );
	LRESULT OnOpMonitor( WPARAM wParam, LPARAM lParam );
	LRESULT OnOpMonSAS( WPARAM wParam, LPARAM lParam );
	~CVolDiaDlg(void);
	char* lpDataReceived;
	int dwDataReceived;
	CVolDiaDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CVolDiaDlg)
	enum { IDD = IDD_VOLDIA_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CVolDiaDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CVolDiaDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
	afx_msg void OnClose();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_VOLDIADLG_H__2CA868C6_52D0_4B30_B465_D26D947791AE__INCLUDED_)
